const express = require('express')
const app = express()
var goodsList = {
    "status": 200,
    "message": "获取购物车数据成功",
    "list": [
        {
            "id": 1,
            "goods_name": "新款阿玛尼男卫衣秋冬厚款流行烫金EA7纯棉套头上衣休闲圆领外套",
            "goods_img": "https://imgservice.suning.cn/uimg1/b2c/image/_LIJKhfghM8D50z7mRByhQ.jpg_800w_800h_4e",
            "goods_price": 100,
            "goods_count": 1,
            "goods_state": true
        }, 
        {
            "id": 2,
            "goods_name": "浪登秋冬男士长袖polo衫莫代尔棉混纺条纹时尚休闲撞色T恤上衣男",
            "goods_img": "https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fimg.alicdn.com%2Fimgextra%2Fi2%2F2780218064%2FTB2or8nayQnBKNjSZFmXXcApVXa_%21%212780218064-0-daren.jpg&refer=http%3A%2F%2Fimg.alicdn.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=auto?sec=1673097176&t=cefb3e0ff1825768e6418c22f4fe0b38",
            "goods_price": 34,
            "goods_count": 10,
            "goods_state": false
        }, {
            "id": 3,
            "goods_name": "NASA联名梵高星空圆领卫衣男士2022年秋冬款潮牌加绒情侣上衣",
            "goods_img": "https://imgservice.suning.cn/uimg1/b2c/image/sqcVngIXGyQhR0f3tFZRLg.jpg_800w_800h_4e",
            "goods_price": 230,
            "goods_count": 1,
            "goods_state": true
        }, {
            "id": 4,
            "goods_name": "恒源祥长袖t恤男中老年人加绒保暖男士上衣宽松休闲爸爸装polo衫",
            "goods_img": "https://img12.360buyimg.com/n1/jfs/t1/116261/35/12882/148443/5f153694E42aba9a6/964c887f9c10f390.jpg",
            "goods_price": 300,
            "goods_count": 3,
            "goods_state": false
        }, {
            "id": 5,
            "goods_name": "连帽卫衣男装套装秋冬季宽松潮学生休闲大码衣服外套搭配帅气一套",
            "goods_img": "https://img11.360buyimg.com/n1/s350x449_jfs/t1/177794/32/5971/180087/60adf0e9Ef9d5b498/4fd06789ac388bbc.jpg%21cc_350x449.jpg",
            "goods_price": 150,
            "goods_count": 33,
            "goods_state": true
        }, {
            "id":6,
            "goods_name": "NASA联名梵高星空圆领卫衣男士2022年秋冬款潮牌加绒情侣上衣",
            "goods_img": "https://imgservice.suning.cn/uimg1/b2c/image/sqcVngIXGyQhR0f3tFZRLg.jpg_800w_800h_4e",
            "goods_price": 333,
            "goods_count": 3,
            "goods_state": false
        }, {
            "id": 7,
            "goods_name": "NASA联名梵高星空圆领卫衣男士2022年秋冬款潮牌加绒情侣上衣",
            "goods_img": "https://imgservice.suning.cn/uimg1/b2c/image/sqcVngIXGyQhR0f3tFZRLg.jpg_800w_800h_4e",
            "goods_price": 222,
            "goods_count": 2,
            "goods_state": true
        }, {
            "id": 8,
            "goods_name": "NASA联名梵高星空圆领卫衣男士2022年秋冬款潮牌加绒情侣上衣",
            "goods_img": "https://imgservice.suning.cn/uimg1/b2c/image/sqcVngIXGyQhR0f3tFZRLg.jpg_800w_800h_4e",
            "goods_price": 111,
            "goods_count": 1,
            "goods_state": false
        }
    ]
}
app.get('/getGoods', (req, res) => {
    res.setHeader("Access-Control-Allow-Origin", "*")
    res.send(goodsList)
})

app.listen(8000, function () {
    console.log('http://localhost:8000');

})